Get-Mariadb-Lock names a function, with lambda list (LOCK-STRING &KEY IF-NOT-LOCKED TIMEOUT):
Obtain database lock LOCK-STRING.
See TOOTSVILLE WITH-CLUSTER-WIDE-LOCK-HELD for a practical use of this.
LOCK-STRING is passed to the MariaDB server and a global lock by that name is obtained via mySQL function GET_LOCK(STRING), if possible.
If the lock is busy, IF-NOT-LOCKED determines the next action.
Wait for up to TIMEOUT seconds for the lock to be freed. If the lock cannot be obtained within TIMEOUT seconds, signal an error of type CLUSTER-WIDE-LOCK-BUSY-ERROR. If TIMEOUT is NIL, wait indefinitely until the lock can be obtained.
Skip BODY and return NIL.
Signal a warning of type CLUSTER-WIDE-LOCK-BUSY-WARNING, then skip BODY and return NIL.
Signal an error of type CLUSTER-WIDE-LOCK-BUSY-ERROR.
Returns an opaque identifier that can be passed to ‘YIELD-DB-LOCK’ to release the lock.
LOCK-NAME is case-insensitive.
Defined in file src/db/maria.lisp.